﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="./css/iconfont/demo.css">
    <link rel="stylesheet" href="./css/iconfont/iconfont.css">
<style>
a{
    padding-right: 15px;
    text-decoration: blink;
    }
</style>
	<div style="margin:20px 0;">
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="$('#addItemCat').window('open')">新增根类目</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="edit()">编辑类目信息</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="save()">保存类目信息</a>
	</div>
	<div style="margin:20px 0;"></div>	
	<table id="tg" class="easyui-treegrid" title="商品类目列表" style="width:100%;height:500px"
			data-options="
				iconCls: 'icon-ok',
				rownumbers: true,
				animate: true,
				collapsible: true,
				fitColumns: true,
				url: './item/cat/list',
				method: 'get',	
				idField: 'id',
				treeField: 'text',
				onContextMenu: onContextMenu
			">
		<thead>
			<tr>
				<th data-options="field:'text',width:180,editor:'text'">类目名称</th>
				<th data-options="field:'status',width:60,align:'right',editor:{type:'combobox',options:{
							valueField:'statusId',
							textField:'name',
							data:statusvalue,
							required:true
						}}">状态</th>
				<th data-options="field:'sortOrde',width:80,editor:'numberbox'">排列序号</th>
				<th data-options="field:'isParent',width:80,editor:{type:'combobox',options:{
							valueField:'isParentId',
							textField:'name',
							data:isParentvalue,
							required:true
						}}">是否为父类目</th>
				 <th data-options="field:'photoX',width:120,formatter:formatImages">图标信息</th>
	             <th data-options="field:'id',width:120,formatter:formatProgress">上传图标</th>
			</tr>
		</thead>
	</table>
	<div id="mm" class="easyui-menu" style="width:120px;">
		<div onclick="append()" data-options="iconCls:'icon-add'">新增子类目</div>
		<!-- <div onclick="edit()" data-options="iconCls:'icon-edit'">编辑给类目</div> -->
		<div onclick="removeIt()" data-options="iconCls:'icon-remove'">删除子类目</div>
		<div class="menu-sep"></div>
		<div onclick="collapse()">收起所有类目</div>
		<div onclick="expand()">展开所有</div>
	</div>
	<div id="addItemCat" class="easyui-window" title="添加商品类目" data-options="iconCls:'icon-save',closed:'true'" style="width:500px;height:500px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'center'" style="padding:10px;">
				<div style="margin-bottom:20px">
			<div>类目名称:</div>
			<input class="easyui-textbox" data-options="prompt:'请输入商品类目名称'" style="width:100%;height:32px"  id="name">
		</div>
		<div style="margin-bottom:20px">
			<div>排序列号:</div>
			<input class="easyui-numberspinner" value="0" data-options="increment:1" style="width:120px;" id="sortOrder"></input>
		</div>		
			</div>
			<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
				<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="add()" style="width:80px">Ok</a>
				<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#addItemCat').window('close')" style="width:80px">Cancel</a>
			</div>
		</div>
	</div>
	<div id="itemCatEditWindow" class="easyui-window" title="上传图片" data-options="modal:true,closed:true,iconCls:'icon-save',href:'item-cat-add'" style="width:80%;height:80%;padding:10px;">
	
	<script src="./js/item-cat.js"></script>